package cool.houge.pig;

/**
 * OAuth 授权类型.
 *
 * @author KK (kzou227@qq.com)
 */
public enum AuthGrantType {
  /** 验证码. */
  AUTHORIZATION_CODE("authorization_code"),
  /** 用户名密码. */
  PASSWORD("password"),
  /** 刷新令牌. */
  REFRESH_TOKEN("refresh_token"),

  // *** ============================ 自定义授权类型 ============================ *** //
  /** 短信验证码. */
  HOUGE_SMS_CODE("houge:sms_code"),
  /** 二维码. */
  HOUGE_QR_CODE("houge:qr_code"),
  /**
   * <a
   * href="https://developers.weixin.qq.com/miniprogram/dev/framework/server-ability/backend-api.html">微信
   * jscode 授权</a>.
   */
  HOUGE_WEIXIN_JS_CODE("houge:weixin:js_code"),
  ;
  private final String grantType;

  AuthGrantType(String grantType) {
    this.grantType = grantType;
  }

  /**
   * 返回授权类型代码.
   *
   * @return 授权类型代码
   */
  public String getGrantType() {
    return grantType;
  }
}
